package com.itheima.demo05;

//权限修饰符
public class Code {
    private String name;//姓名: name
    private int id;//工号: id
    private int salary;//工资: salary

    //getXxx()和setXxx()
    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public int getSalary() {
        return salary;
    }

    public void setSalary(int salary) {
        this.salary = salary;
    }


    public Code() {
    }

    //构造方法:
    public Code(int id, int salary, String name) {
        this.name = name;
        this.id = id;
        this.salary = salary;
    }

    //工作
    public void work() {
        System.out.println("工号为" + getId() + ", 基本工资为" + getSalary() + "的程序员" + getName() + "正在努力的写着代码.....");
    }
}
